package net.game.server;

import net.game.server.io.net.ServerPipelineFactory;
import net.game.server.util.Constants;
import net.game.server.util.log.Logger;
import org.jboss.netty.bootstrap.ServerBootstrap;
import org.jboss.netty.channel.socket.nio.NioServerSocketChannelFactory;

import java.net.InetSocketAddress;
import java.util.concurrent.Executors;

public class Server implements Constants  {

    public static void main(String[] args) {
        final ServerBootstrap bootstrap = new ServerBootstrap(new NioServerSocketChannelFactory(Executors.newCachedThreadPool(),Executors.newCachedThreadPool()));
        bootstrap.setPipelineFactory(new ServerPipelineFactory());
        bootstrap.bind(new InetSocketAddress(PORT));
        Logger.put("Listening on port " + PORT);
    }
}
